package com.sinog.front.controller.work;

import com.sinog.core.model.UserDTO;
import com.sinog.front.feign.biz.work.WorkService;
import com.sinog.front.service.user.UserFacade;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;

/**
 * @desc 首页 - 工作台
 * @author lk
 * @date -
 */
@RestController
public class WorkController {

    @Resource
    private WorkService workService;
    @Resource
    private UserFacade userFacade;

    /**
     * 首页 - 工作台 - 查询工作台全部状态
     * @param searchKey searchKey
     * @param sortField 排序字段
     * @param sortOrder 排序方式
     * @return String
     */
    @RequestMapping("/azbj/verification/info/work")
    public String getWorkVerificationList(@RequestParam(required = false) Map<String,String> searchKey,
                                          @RequestParam(required = false) String sortField,
                                          @RequestParam(required = false) String sortOrder) {
        UserDTO authentication = userFacade.getAuthentication();
        searchKey.put("sortField", sortField);
        searchKey.put("sortOrder", sortOrder);
        searchKey.put("departid",authentication.getDepartid());
        searchKey.put("level",authentication.getLevel());
        searchKey.put("account",authentication.getAccount());
        return workService.getVerificationWorkList(searchKey);
    }
}